<div id="menu">
 <?php foreach ($menu as $m):?>

 <a href="<?=site_url('admin990/catalogue')?>/<?=$m->id?>"><li <?php if($this->uri->segment(3) == $m->id ){?>class="active" <?php }elseif($this->uri->segment(3)==NULL && $m->id=='1' && $this->uri->segment(2)=='catalogue'){?>class="active" <?php }?>>
<?=$m->cat_name?></li></a>
 <?php endforeach;?>

<div class="clear"></div>
</div>
<div id="submenu">
 <?php foreach ($submenu as $sub):?>
<a href="<?=site_url('admin990/catalogue')?>/<?=$sub->parent_id?>/<?=$sub->id?>"><li <?php if($this->uri->segment(4) == $sub->id ){?>class="active" <?php }?>>
<?=$sub->cat_name?>
</li></a>
<?php endforeach;?>
<?php if($this->uri->segment(3)==4){?>
<a href="<?=site_url('admin990/catalogue/addmenu')?>?parent_id=<?=$this->uri->segment(3)?>"><li>|  <img src="<?=base_url()?>/resources/imgs/add.png" height="12" alt="nouveau menu" title="nouveau menu"> nouveau menu |</li></a>
<?php }?>
 <a href="<?=site_url('admin990/catalogue/addproduct')?>?category_id=<?=$this->uri->segment(4)?>"><li>|  <img src="<?=base_url()?>/resources/imgs/add.png" height="12" alt="nouveau produit" title="nouveau produit"> nouveau produit |</li></a>
<div class="clear"></div>
</div>
<div class="product">
<table width="100%" align="center" >
<thead>
<th>Référence ( num )</th>
<th>Nom</th>
<th>Catégorie</th>
<th>Prix</th>
<th>Etat</th>
</thead>
<tbody>
<?php foreach ($product as $p):?>
<tr onclick="document.location.href='<?=site_url('admin990/products')?>/<?=$p->id?>?category_id=<?=$this->uri->segment(3)?>'"> 
<td><?=$p->product_num?></td>
<td><?=$p->product_name?></td>
<td><?=$p->cat->cat_name?></td>
<td><?=$p->product_price?> €</td>
<td><?php if($p->status != null){?><img src="<?=base_url()?>/resources/imgs/block_yes.png" height="15" alt="disponible" title="disponible"><?php }else{?><img src="<?=base_url()?>/resources/imgs/block_no.png" height="15" alt="non disponible" title="non disponible"> <?php }?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>

</div>
</body>
</html>